<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    <head>
        <title><?php echo $store_name;?></title>
        <meta charset="UTF-8">
        <meta name="description" content="<?php echo $action['action_name'];?>">
        <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1">
        <link href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
        <script type='text/javascript' src='/public/js/jquery-3.1.1.min.js'></script>
        <script type="text/javascript" src='/public/js/jquery.validate.js'></script>
        <script>
            var _hmt = _hmt || [];
            (function () {
                var hm = document.createElement("script");
                hm.src = "//hm.baidu.com/hm.js?8d43b5b5d798921b66d689f7a792e6e2";
                var s = document.getElementsByTagName("script")[0];
                s.parentNode.insertBefore(hm, s);
            })();
        </script>
        <script type="text/javascript">
            document.domain = '<?php echo _DOMAIN_ALL_;?>';
        </script>
        <link rel="shortcut icon" type="image/ico" href="/favicon.ico">
    </head>
    <body >


   <link href="/public/css/main.css" rel="stylesheet">
   <div class="container"  >
        <div >
            <div style='margin-top:1.5rem;text-align:center;' ><b style='font-size:2rem;' >用户反馈</b> &nbsp;&nbsp;V.1.3 </div>
            <div style='font-size:1.5rem;' >
                <span  >请选择反馈类型：</span>
                <div class='_cut2' ></div>
                <form id='form' action="" method="post">
                <?php $answer = json_decode($feedback['answer'],true); foreach($answer as $k=>$v){ ?>
                    <input name="daan" id='daan' type="radio" value="<?php echo $k; ?>" <?php  if($k==0){ echo "checked='checked'"; } ?> />&nbsp;<?php echo $v; ?>&nbsp;&nbsp;
                    <?php } ?>
                    <div class='_line'></div>
                    <textarea name='_text' id='_text'  class="_textarea" style='height:17rem;' placeholder="&nbsp;&nbsp;&nbsp;&nbsp;随着社会的不断进步，我们的钱袋变胖了，但是好像它变瘦的速度更快。高速发展的社会不仅带来了生活体验的提升，也让我们也越来越不了解身边的生活。很多时候，我们想要参与其中却被各种规则屏蔽在外。现在，KAKA 与你携手共创自己的美腻！打破规则，参与其中——我的美丽我做主。
                    卡卡维护世界和平 (^_^)" ></textarea> 
                    
                </form>
            </div>
            <div class='_line3' ></div>
            <div style='font-size:1.5rem;float:left;' >反馈用户：<span style='color:#169bd5;' id='_user' ><?php echo $user?$user:"未登录"; ?></span> 
                <input type='hidden' id='_user_' value="<?php echo $user?$user:''; ?>" >
            </div>
            <div class='_line3' ></div>
            <div  style='text-align:center;' > <input class="btn btn-primary btn-lg" style="width:90%;background-color:#FF79BC;border-color:white" name="" type="button" id='_submit_' value="提交" >  </div>
            <div class='_line3' ></div>
            <div  id='questionnaire' style='font-size:1.5rem;float:right;color:#169bd5;' class="glyphicon glyphicon-hand-right" >问卷调查</div>
            <div class='_line3' style='clear:both;'  ></div>
            <div class='_cut2'  ></div>
            <div> 
                <div style='color:#169bd5;' >感谢以下小伙伴在  KAKA V.1.2  版本中的支持和帮助 </div>
                <div  style="text-align: center;width:100%;">
                    <div   class='_suggest_list_1' >韩&nbsp;&nbsp;&nbsp;&nbsp;晞   136****0751</div>
                    <div   class='_suggest_list_2' >张&nbsp;&nbsp;&nbsp;&nbsp;晴   187****4257</div>
                    <div   class='_suggest_list_1' >杨文萱   186****5260</div>
                    <div   class='_suggest_list_2' >萧美美   183****8760</div>
                    <div   class='_suggest_list_1' >刘昕蕊   188****7657</div>
                    <div   class='_suggest_list_2' >彭若曦   186****6493</div>
                    <div   class='_suggest_list_1' >赵&nbsp;&nbsp;&nbsp;&nbsp;婧   131****6649</div>
                    
                </div>
            </div>
        </div>
   </div>
<script type="text/javascript">
    $(document).ready(function(){
        $('#_submit_').click(function(){
            var user = $('#_user_').val();
            var _mobile = /^(((1[1-9]{1}[0-9]{1})|(15[0-9]{1}))+\d{8})$/;
            if( _mobile.test(user) ){
                var content = $('#_text').val()
                if(content){
                    var daan = $("input[name='daan']:checked").val();
                    $.ajax({url: "/center/questionnaire/submit_suggetion?store_id=<?php echo (int)$_GET['store_id'];?>&content=" + content+"&daan="+daan+"&mobile="+user, async: true, success: function (msg) {
                        if (msg == 'false') {
                            alert('提交失败！');
                        }else{
                            alert('您好！您的反馈我们已经收到，我们将会尽快核实您所反馈的信息。感谢您对我们的支持！');
                            history.go(-1);
                        }
                    }

                    });
                }else{
                    alert('请填写内容！');
                    return;
                }
                
            }else{
                $('#login').show();
            }
        });


        $('#questionnaire').click(function(){
            window.location.href = "<?php echo buildUrl('/center/questionnaire/questions',(int)$_GET['barber_id']);?>"
        });


    });

    function _code() {
        var mobile = $("#account").val();
        var reg=/^(((1[1-9]{1}[0-9]{1})|(15[0-9]{1}))+\d{8})$/;
        if(mobile==''){
            $('#check_mobile').html('请输入手机号');
            return;
        }
        if(!reg.test(mobile)){
            $('#check_mobile').html('请正确输入手机号');
            return;
        }
        $.ajax({url: "/user/passport/code?store_id=<?php echo (int)$_GET['store_id'];?>&mobile=" + mobile, async: true, success: function (msg) {
                if (msg != 'true') {
                    alert(msg);
                    return false;
                }
                $("#subcode").val('60');
                $("#subcode").attr('disabled', 'disabled');
                var t = setInterval(function () {
                    var m = $("#subcode").val();
                    var str = parseInt(m) - 1;
                    if (str <= 0) {
                        str = '获取验证码';
                        $("#subcode").removeAttr('disabled');
                        clearInterval(t);
                    }
                    $("#subcode").val(str);
                }, 1000);
            }
        });
    }

    function _submit(){
        var mobile = $("#account").val();
        var code=$('#code').val();
        var store_id = "<?php echo (int)$_GET['store_id']; ?>";
        var reg=/^(((1[1-9]{1}[0-9]{1})|(15[0-9]{1}))+\d{8})$/;
        
        if(mobile=='' ){
            $('#check_mobile').html('请正确输入手机号');
            return;
        }
        if(!reg.test(mobile)){
            $('#check_mobile').html('请正确输入手机号');
            return;
        }
        if(code==''){
            $('#check_code').html('请输入验证码');
            return;
        }
        $.ajax({
            url: "/center/questionnaire/suggest_login?code=" + code + "&mobile=" + mobile+"&store_id="+store_id, async: true, success: function (msg) {
                if (msg == 'false') {
                    alert('验证码错误');
                }else{
                    $('#_user').html(msg);
                    $('#_user_').val(msg);
                    $('#login').hide();
                }    
            }
        });
    }

</script> 

<div id='login'  style="text-align: center;width:100%;height:100%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#8E8E8E',endColorstr='##8E8E8E');background-color:rgba(79, 79, 79, 0.7);position:fixed; _position:absolute; top:0;left:0; z-index:5000;display:none " >
    <div  class='passport_div' style='width:80%;' >
        <div   style='width:80%;margin: 10rem auto;background-color: white;text-align:center;' >
            <div class='_line' ></div>
            <div style='text-align:center;font-size:2rem;' ><b>请先登录 </b></div>
        <form  id='login_form'>
            <?php if($_GET["msg"]==1){?>
            <div><font style="color:red">账号或验证码错误</font></div>
            <?php }?>
            <div class='_line' ></div>
            <div class='form-group'>
                <input type="text" class="form-control" id='account' name='account' placeholder="手机号" value=""  />
                <span id='check_mobile' style='color:red'> </span>
            </div>
            <div class='form-group' style="text-align: right">
                <input type="text" class="form-control" name="code" id='code' placeholder="验证码" value="" style='float:left;width:60%;' />
                <input type="button" id='subcode' class="form-control" onclick="_code();" style='float:right;width:35%;'  value="获取验证码"  >
                <br style='clear:both' >
                <div id='check_code' style='color:red;text-align:left;'> </div>
            </div>
            <div class="form-group login_sub" >
                <input type="button" class="btn btn-info form-control" onclick='_submit()' name="登录" value="登&nbsp;&nbsp;&nbsp;录" style='background:rgba(0,0,0,0);color:black;border-color:#ddd;'>
            </div>
        </form>
        <div class='_line' ></div>
        </div>
    </div>
</div>